package com.dao;

import com.entity.Dept;
import com.service.DeptService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {

        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Dept dept = context.getBean("deptService", DeptService.class).getNameById(2);
        System.out.println(dept);

        Dept dept2 = context.getBean("deptService", DeptService.class).getNameById(2);
        System.out.println(dept2);

     /*   Employee employee = context.getBean("empService", EmpService.class).getNameById(2);
        System.out.println(employee);*/

    }
}
